//
//  ViewController.m
//  UI29_block(实现页面传值)
//
//  Created by dllo on 16/1/20.
//  Copyright © 2016年 刘旺辉. All rights reserved.
//

#import "ViewController.h"
#import "SecondViewController.h"
@interface ViewController ()
@property (weak, nonatomic) IBOutlet UILabel *label;
@property (nonatomic, copy) void(^block1)(NSString *);
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    __weak typeof(self)weakSelf = self;
    
    self.block1 = ^(NSString *str) {
      
        weakSelf.label.text = str;
    };
    
}
- (IBAction)handleAction:(id)sender {
    
    SecondViewController *second = [[SecondViewController alloc] init];
    second.block2 = self.block1;
    [self.navigationController pushViewController:second animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
